@extends('layouts.admin')
@section('content')
    <!--面包屑导航 开始-->
    <div class="crumb_warp">
        <!--<i class="fa fa-bell"></i> 欢迎使用登陆网站后台，建站的首选工具。-->
        <i class="fa fa-home"></i> <a href="{{url('admin/info')}}">首页</a> &raquo; <a href="{{url('admin/user')}}">用户管理</a> &raquo; 修改用户
    </div>
    <!--面包屑导航 结束-->

	<!--结果集标题与导航组件 开始-->
	<div class="result_wrap">
        <div class="result_title">
            <h3><a href="{{url('admin/user')}}"><i class="fa fa-reply"></i>返回</a></h3>
            @if(count($errors)>0)
                <div class="mark">
                    @if(is_object($errors))
                        @foreach($errors->all() as $error)
                            <p>{{$error}}</p>
                        @endforeach
                    @else
                        <p>{{$errors}}</p>
                    @endif
                </div>
            @endif
        </div>
    </div>
    <!--结果集标题与导航组件 结束-->
    
    <div class="result_wrap">
        <form action="" method="post">
            {{csrf_field()}}
            <input type="hidden" class="lg" name="id" value="{{$user->id}}">
            <table class="add_tab">
                <tbody>
                    <tr>
                        <th><i class="require">*</i>所属用户组：</th>
                        <td>
                            <select name="g_id">
                                @foreach($groups as $v)
                                    <option value="{{$v->id}}"
                                            @if(count($group)>0)
                                                @if($group->id==$v->id)
                                                    selected="selected"
                                                @endif
                                            @endif
                                    >{{$v->name}}</option>
                                @endforeach
                            </select>
                        </td>
                    </tr>
                    <tr>
                        <th><i class="require">*</i>登陆邮箱：</th>
                        <td>
                            <input type="text" class="lg" name="email" disabled="disabled" value="{{$user->email}}">
                        </td>
                    </tr>

                    <tr>
                        <th><i class="require">*</i>新密码：</th>
                        <td>
                            <input type="password" name="password"> </i>新密码6-20位 (不修改密码请留空)</span>
                        </td>
                    </tr>

                    <tr>
                        <th><i class="require">*</i>确认密码：</th>
                        <td>
                            <input type="password" name="password_confirmation"> </i>再次输入密码</span>
                        </td>
                    </tr>

                    <tr>
                        <th>昵称：</th>
                        <td>
                            <input type="text" class="lg" name="nickname" value="{{$user->nickname}}">
                        </td>
                    </tr>
                    <tr>
                        <th></th>
                        <td>
                            <input type="submit" value="提交">
                            <input type="button" class="back" onclick="history.go(-1)" value="返回">
                        </td>
                    </tr>
                </tbody>
            </table>
        </form>
    </div>
@endsection